package com.example.spring;

import com.example.spring.bean.Clazz;
import com.example.spring.bean.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:cascade
 * Package:com.example.spring
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/8-15:34
 * @Version:v1.0
 */
//级联属性赋值
public class cascade {
    @Test
    public void testCascade() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("cascade.xml");
        Student studentBean = applicationContext.getBean("StudentBean", Student.class);
        Clazz clazzBean = applicationContext.getBean("ClazzBean", Clazz.class);
        System.out.println(studentBean);
        System.out.println(clazzBean);
    }
}
